package com.test.aes.controller;

import com.test.aes.pojo.SysUser;
import com.test.aes.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/sysUser")
public class SysUserController {
    @Resource
    private SysUserService sysUserService;


    /**
     * 添加数据
     */
    @PostMapping("save")
    public Map<String,Object> saveUserInfo(@RequestBody SysUser sysUser) {
        return sysUserService.saveUserInfo(sysUser);
    }
    /**
     * 获取数据
     */
    @PostMapping("get")
    public Map<String,Object>  getUserInfo(@RequestParam("id") Integer id) {
        return sysUserService.getUserInfo(id);
    }
    /**
     * 更新数据
     */
    @PostMapping("update")
    public Map<String,Object>  updateUserInfo(@RequestBody SysUser sysUser) {
        return sysUserService.updateUserInfo(sysUser);
    }
}